package com.roi.model;

import java.io.Serializable;

public abstract class Account implements Serializable {
	private static final long serialVersionUID = -7915591167434520709L;
	protected int accountNumber;
	protected Customer c;
	protected Statement s;
	protected double balance;
	protected double interestRate;

	public Account(Customer customer) {
		this.c = customer;
		this.accountNumber = AccController.count;
		this.s = new Statement();
	}

	public void printStatement() {

	}

	public void deposit(double amount) {
		if (amount > 0) {
			balance += amount;
			System.out.println("New balance: " + balance);
		} else {
			System.out.println("deposit amount cannot be negative");
		}
	}

	public void withdraw(double amount) {
		if (amount > 0) {
			balance -= amount;
			System.out.println("New balance: " + balance);
		} else {
			System.out.println("withdrawl amount cannot be negative");
		}
	}

	public void transfer(double amount, int destAccount) {

	}

	public int getAccountNumber() {
		return accountNumber;
	}

	public double getBalance() {
		return balance;
	}

	@Override
	public boolean equals(Object obj) {
		Account a = (Account) obj;
		return this.accountNumber == a.accountNumber;
	}

}
